<?PHP
/* Copyright 2012-2023, Aming International.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2,
 * as published by the Free Software Foundation.
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * Plugin development contribution by Aming
 *
 * Version log:
 * Version 1.9   Modified by Aming       - 添加系统
 */
?>
<?
$plugin = "dynamix.system.autofan";
$log_file = dirname(__DIR__).'/scripts/autofan.log';
$max_lines = 200;

if (file_exists($log_file)) {
    $lines = file($log_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    $start = max(count($lines) - $max_lines, 0);

    foreach (array_reverse(array_slice($lines, $start)) as $line) {
        echo htmlspecialchars($line) . "<br>";
    }
} else {
    echo "暂无日志";
}
?>